<?php
/*
 * @Author: CHINAKAIYUAN<sunkaiyuan@namenode.cn>
 * @Date: 2022-02-03 00:33:05
 * @LastEditTime: 2023-10-29 14:56:33
 * @LastEditors: 孙开源 && sunkaiyuan@namenode.cn
 * @Description: 工序收货，染色收货，倒毛收货
 */

namespace App\Models;

use App\Traits\AutoCodeTrait;
use App\Traits\CommonUserTrait;
use App\Traits\MaterialTrait;
use App\Traits\SoftDeletesTrait;
use App\Traits\StorageTrait;
use App\Traits\CarryTrait;
use App\Traits\CarTrait;

class ProProcessesInspectPack extends BaseModel
    {
    // use AutoCodeTrait;
    use StorageTrait;
    use CommonUserTrait;
    use MaterialTrait;
    use SoftDeletesTrait;
    public $timestamps = true;
    public $table = "sys_pro_processes_inspect_pack";
    protected $guarded = [];
    protected $casts = [];
    // // 
    // protected $ACSign = 'INSPECT_PROCESS';

    public function main()
        {
        return $this->belongsTo(ProProcessesInspect::class, "inspect_id");
        }

    public function material()
        {
        return $this->main->material();
        }
    public function getStorageMergeData()
        {
        return [
            'reel'    => $this->reel,
            'barcode' => $this->code,
        ];
        }
    public function checkmac()
        {
        return $this->belongsTo(Loom::class);
        }
    public function scrap()
        {
        return $this->hasMany(CustomerStorageInspectPackScrap::class, "main_id");
        }

    public function style_mdl()
        {
        return $this->belongsTo(CustomerStorageStyle::class, "style_id");
        }
    }
